Aspect-Oriented Compilers
نویسندگان
چکیده
Aspect-oriented programming provides the programmer with means to cross-cut conventional program structures, in particular the class hierarchies of object-oriented programming. This paper studies the use of aspect orientation in structuring syntax directed compilers. Syntax-directed compilers are often speci ed by means of attribute grammars. Such speci cations are typically structured by production | it is hard to structure them by semantic aspects such as `environment', `lexical level' and `type checking'. Even if such structuring is allowed at a syntactic level, it is certainly not possible to parameterise compiler aspects, and to treat them as rst-class objects in the speci cation language. In this paper we propose a technique for making compiler `aspects' rst-class objects, that can be stored, manipulated and combined. We propose a modest set of combinators that achieve this task in the functional programming language Haskell. The combinator library is an application of recent work on polymorphic type systems for record operations, in particular that of Gaster and Jones, and also of a technique due to R emy, which types symmetric record concatenation `for free'. It is hoped that this embedding of an aspect-oriented programming style in Haskell provides a stepping stone towards a more general study of the semantics of aspect-oriented programming.
منابع مشابه
A Compilation and Optimization Model for Aspect-Oriented Programs
This paper presents a semantics-based compilation model for an aspect-oriented programming language based on its operational semantics. Using partial evaluation, the model can explain several issues in compilation processes, including how to find places in program text to insert aspect code and how to remove unnecessary run-time checks. It also illustrates optimization of calling-context sensit...
متن کاملImplementing Java Compilers Using ReRAGs
Rewritable Reference Attributed Grammars (ReRAGs) is a recently developed compiler-compiler technology based on object-orientation, aspect-orientation, reference attributed grammars, and conditional rewrites. In this paper we describe our experiences from using ReRAGs for implementing Java compilers. We illustrate how the usage of ReRAGs renders a rather compact, yet easy-to-understand and modu...
متن کاملProceedings of the First workshop on Virtual Machines and Intermediate Languages for emerging modularization
Current implementations for aspect-oriented programming languages map the aspect-oriented concepts of source programs to object-oriented bytecode. This hinders execution environments with dedicated support for such concepts in applying their optimizations, as they have to recover the original aspect definition from bytecode. To address this representational gap we propose an architecture for im...
متن کاملOptimized Compilation of Around Advice for Aspect Oriented Programs
The technology that supports Aspect-Oriented Programming (AOP) tools is inherently intrusive, since it changes the behavior of base application code. Advice weaving performed by AspectJ compilers must introduce crosscutting behavior defined in advice into Java programs without causing great performance overhead. This paper shows the techniques applied by the ajc and abc AspectJ compilers for ar...
متن کاملOn Weaving Aspects
Object-oriented software systems that are developed using aspect-oriented programming techniques consist of classes and aspects. Classes implement the primary functionality of an application, for example, managing stocks or calculating insurance rates. Aspects, on the other hand, capture technical concerns like persistence, failure handling, communication, or process synchronization. They are w...
متن کامل